[QEMU] ne2000: Stop memory access beyond buffer
authorkaf24@localhost.localdomain <kaf24@localhost.localdomain>
Fri, 27 Oct 2006 16:50:40 +0000 (17:50 +0100)
committerkaf24@localhost.localdomain <kaf24@localhost.localdomain>
Fri, 27 Oct 2006 16:50:40 +0000 (17:50 +0100)
commit94c50cc02b42a2f2fb6c4b2631a5468d15332576
treed8203199f5ee00bd31ebbecd33920989806a4988
parent59f9d8ef4489a9f13397c5115904e230720f23be
[QEMU] ne2000: Stop memory access beyond buffer

As a program that runs in dom0 which serves users from guests,
the qemu drivers need to be vigilant to the input that comes
from the guests since they may be malicious.

As it is there are multiple ways to get ne2000 to read/write
memory beyond the 48K buffer that it has allocated for each
adapter.

This patch checks the addresses and prevents this from occuring.

The boundary is checked each time since it's changed for every
packet received while the other parameters are only changed
(by the guest) during setup.

Signed-off: Herbert Xu <herbert@gondor.apana.org.au>
tools/ioemu/hw/ne2000.c